<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" type="image/ico" th:href="@{/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/index.css}">
    <title>标签管理列表</title>
    <style type="text/css">
        /**# 自定义表单的高度**/
        .layui-table-cell{
            height:auto;
            line-height:28px;
        }
    </style>
</head>
<body class="layui-tab-content">
<div class="layui-card layui-card-body">
<div class="layui-form toolbar" id="queryTools">
    <div class="layui-form-item">
        <label class="layui-form-label">标签名称:</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="name" placeholder="请填写标签名称">
        </div>
        <label class="layui-form-label">标签类别:</label>
        <div class="layui-input-inline">
            <select id="typeQuery" name="typeQuery">
                <option value="">请选择</option>
            </select>
        </div>
        <label class="layui-form-label">创建时间:</label>
        <div class="layui-input-inline">
            <input type="text" lay-verify="date" class="layui-input" id="startDate" placeholder="请选择开始时间">
        </div>
        <div class="layui-input-inline">
            <input type="text" lay-verify="date" class="layui-input" id="endDate" placeholder="请选择结束时间">
        </div>
        <button class="layui-btn" id="btnSearch">查询</button>
        <button class="layui-btn" id="resetSearch">重置</button>
        <button class="layui-btn" id="btnAdd">新增</button>
    </div>
</div>
<table class="layui-hide" id="productTagTable" lay-filter="productTagTable"></table>
</div>
<!--新增修改界面-->
<form class="layui-form" id="editForm" lay-filter="editForm" style="display:none;padding-top:10px">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>标签类别</label>
        <div class="layui-input-block" style="margin-left: 105px;width:60%;">
            <select id="type" name="type" lay-verify="required">
                <option value="">请选择</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>标签名称</label>
        <div class="layui-input-block" style="width:60%;">
            <input type="text" name="name" lay-verify="required|tagLen" autocomplete="off" placeholder="请输入标签名称"
                   class="layui-input layui-form-danger" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>标签图片</label>
        <div class="layui-input-block" style="width: 60%;">
            <div class="layui-upload">
                <button type="button" class="layui-btn" id="uploadBtn">上传图片</button>
                <input name="tagUrl" id="tagUrl"  value="" autocomplete="off" class="layui-input" type="hidden">
                <div class="layui-upload-list" id="uploadListDiv">
                </div>
                <p class="layui-form-mid layui-word-aux">支持jpg、png,最多可上传10M</p>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标签描述</label>
        <div class="layui-input-block" style="width:60%;">
            <textarea placeholder="请输入标签描述" class="layui-textarea" name="remark" lay-verify="textLen"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <button id="saveRecord" class="layui-btn" lay-submit lay-filter="editRecord">保存</button>
    </div>
</form>
<!--列操作-->
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<!--渲染列-->
<script type="text/html" id="imgRender">
    {{# if(d.tagUrl !='' && d.tagUrl !=null){ }}
    <div>
        <img src="{{ d.tagUrl }}">
    </div>
    {{# } }}
</script>

<script type="text/javascript" th:src="@{/js/plugins/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/modules/productTag/list.js}"></script>
</body>
</html>